package com.mdlib.droid.module.home.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mdlib.droid.R;
import com.mdlib.droid.model.entity.HomeLuckEntity;
import com.mdlib.droid.widget.AnimTextView;
import com.mdlib.droid.widget.MagicProgressCircle;

import java.util.List;

/**
 * 作者：HQY on 2018/10/22 16:41
 * 邮箱：hqy_xz@126.com
 */

public class HomeLuckAdapter extends BaseQuickAdapter<HomeLuckEntity, BaseViewHolder> {


    public HomeLuckAdapter(List<HomeLuckEntity> data) {
        super(R.layout.item_home_luck, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeLuckEntity item) {

        MagicProgressCircle mpc = helper.getView(R.id.mpc_home_num);
        mpc.setSmoothPercent(item.getNum(), 1000);
        AnimTextView atv = helper.getView(R.id.atv_home_num);
        atv.setSmoothPercent(item.getNum(), 1000);
        helper.setText(R.id.tv_home_luck, item.getName());
    }
}
